export default {
  install(app: { component: (arg0: any, arg1: any) => void; }) {
    const requireModules = import.meta.glob([
      '@/views/*/index.tsx',
      '@/views/*/*/index.tsx',
      '!./index.tsx',
      '@/components/common/svgIcon.vue',
      '@/components/common/**/subs/**/*.tsx'
    ], { eager: true })
    console.log('requireModules', requireModules)
    Object.values(requireModules).forEach(module => {
      const Module: any = module;
      const name = Module?.default?.name;
      const componentName = name.charAt(0).toUpperCase() + name.slice(1)
      // 经过app.component注册后.tsx和.vue模版语法中都可以使用 
      app.component(componentName, Module.default)
    })
  }
}
